package com.ruoyi.device.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.device.mapper.DeviceMaintainMapper;
import com.ruoyi.device.domain.DeviceMaintain;
import com.ruoyi.device.service.IDeviceMaintainService;
import com.ruoyi.common.core.text.Convert;

/**
 * 设备维护管理Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-01-12
 */
@Service
public class DeviceMaintainServiceImpl implements IDeviceMaintainService 
{
    @Autowired
    private DeviceMaintainMapper deviceMaintainMapper;

    /**
     * 查询设备维护管理
     * 
     * @param deviceId 设备维护管理主键
     * @return 设备维护管理
     */
    @Override
    public DeviceMaintain selectDeviceMaintainByDeviceId(String deviceId)
    {
        return deviceMaintainMapper.selectDeviceMaintainByDeviceId(deviceId);
    }

    /**
     * 查询设备维护管理列表
     * 
     * @param deviceMaintain 设备维护管理
     * @return 设备维护管理
     */
    @Override
    public List<DeviceMaintain> selectDeviceMaintainList(DeviceMaintain deviceMaintain)
    {
        return deviceMaintainMapper.selectDeviceMaintainList(deviceMaintain);
    }

    /**
     * 新增设备维护管理
     * 
     * @param deviceMaintain 设备维护管理
     * @return 结果
     */
    @Override
    public int insertDeviceMaintain(DeviceMaintain deviceMaintain)
    {
        deviceMaintain.setCreateTime(DateUtils.getNowDate());
        return deviceMaintainMapper.insertDeviceMaintain(deviceMaintain);
    }

    /**
     * 修改设备维护管理
     * 
     * @param deviceMaintain 设备维护管理
     * @return 结果
     */
    @Override
    public int updateDeviceMaintain(DeviceMaintain deviceMaintain)
    {
        return deviceMaintainMapper.updateDeviceMaintain(deviceMaintain);
    }

    /**
     * 批量删除设备维护管理
     * 
     * @param deviceIds 需要删除的设备维护管理主键
     * @return 结果
     */
    @Override
    public int deleteDeviceMaintainByDeviceIds(String deviceIds)
    {
        return deviceMaintainMapper.deleteDeviceMaintainByDeviceIds(Convert.toStrArray(deviceIds));
    }

    /**
     * 删除设备维护管理信息
     * 
     * @param deviceId 设备维护管理主键
     * @return 结果
     */
    @Override
    public int deleteDeviceMaintainByDeviceId(String deviceId)
    {
        return deviceMaintainMapper.deleteDeviceMaintainByDeviceId(deviceId);
    }
}
